<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"  
                xmlns:h="http://java.sun.com/jsf/html"  
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./../templates/StaffTemplate.xhtml">

    <ui:define name="nav_menu">
        <p:menubar model="#{staffChangeInitialPasswordManagedBean.staffMenuModel}"/>
    </ui:define>
    <ui:define name="content">
        <f:view beforePhase="#{tCubeULPManagerBean.initViewRedemption}"/>  
        <h1>Review redemption details</h1>
        <p:growl id="messages" />
        <br/>
        <br/>
        <p:fieldset style="width:1050px">
            <h2>POINT REDEMPTION DETAIL</h2>
            <h:panelGrid columns="2" border="0" columnClasses="column" cellpadding="5" style="width:1050px">
                <h:panelGrid columns="2" border="1" columnClasses="column" cellpadding="5">

                    <h:outputText value="Customer name: " style="font-weight:bold; text-align:center; font-size:12px" />
                    <h:outputText value="#{tCubeULPManagerBean.selectedRedemption.customer.tourist.firstName} #{tCubeULPManagerBean.selectedRedemption.customer.tourist.lastName}" />

                    <h:outputText value="Customer email address: " style="font-weight:bold; text-align:center; font-size:12px" />
                    <h:outputText value="#{tCubeULPManagerBean.selectedRedemption.customer.tourist.email}" />

                    <h:outputText value="Voucher Reference Number: " style="font-weight:bold; text-align:center; font-size:12px" />
                    <h:outputText value="#{tCubeULPManagerBean.selectedRedemption.referenceNumber}" />

                    <h:outputText value="Voucher name: " style="font-weight:bold; text-align:center; font-size:12px" />
                    <h:outputText value="#{tCubeULPManagerBean.selectedRedemption.redemptionList.name}" />

                    <h:outputText value="Redemption Date:" style="font-weight:bold; text-align:center; font-size:12px"/>
                    <h:outputText value="#{tCubeULPManagerBean.selectedRedemption.dateCreated}">
                        <f:convertDateTime dateStyle="full" timeZone="EST" type="date" />
                    </h:outputText>

                    <h:outputText rendered="#{!tCubeULPManagerBean.selectedRedemption.dateUsed==null}" value="Redeemed at:" style="font-weight:bold; text-align:center; font-size:12px"/>
                    <h:outputText rendered="#{!tCubeULPManagerBean.selectedRedemption.dateUsed==null}" value="#{tCubeULPManagerBean.selectedRedemption.branch.name}"/>             

                    <h:outputText rendered="#{!tCubeULPManagerBean.selectedRedemption.dateUsed==null}" value="Redemption Date:" style="font-weight:bold; text-align:center; font-size:12px"/>
                    <h:outputText rendered="#{!tCubeULPManagerBean.selectedRedemption.dateUsed==null}" value="#{tCubeULPManagerBean.selectedRedemption.dateUsed}">
                        <f:convertDateTime dateStyle="full" timeZone="EST" type="date" />
                    </h:outputText>

                    <h:outputText value="Expiry Date: " style="font-weight:bold; text-align:center; font-size:12px"/>
                    <h:outputText value="#{tCubeULPManagerBean.selectedRedemption.dateExpired}">
                        <f:convertDateTime dateStyle="full" timeZone="EST" type="date" />
                    </h:outputText>

                    <h:outputText value="Offered by: " style="font-weight:bold; text-align:center; font-size:12px"/>
                    <h:outputText value="#{tCubeULPManagerBean.selectedRedemption.redemptionList.stakeholder.corpName}"/>

                    <h:outputText value="Total points used: " style="font-weight:bold; text-align:center; font-size:12px"/>
                    <h:outputText value="#{tCubeULPManagerBean.selectedRedemption.redemptionList.pointsToRedeem} points"/>

                    <h:outputText value="Status: " style="font-weight:bold; text-align:center; font-size:12px"/>
                    <h:outputText value="#{tCubeULPManagerBean.returnRedemptionStatus(tCubeULPManagerBean.selectedRedemption.dateUsed==null)}"/>
                </h:panelGrid>

                <p:graphicImage id="imageDisplay" value="/images/upload/media/#{tCubeULPManagerBean.selectedRedemption.redemptionList.imageURL}"
                                height="300" width="450"/> 

            </h:panelGrid>
            <br/> 

        </p:fieldset>
        <p:fieldset legend="Company's contact details" toggleable="true" toggleSpeed="500"
                    onToggleUpdate="growl" style="width:1050px">
            <h:panelGrid columns="2" columnClasses="column" cellpadding="5">
                <h:outputText value="Company name: " />
                <h:outputText value="#{tCubeULPManagerBean.selectedRedemption.redemptionList.stakeholder.corpName}" />

                <h:outputText value="Phone number: " />
                <h:outputText value="#{tCubeULPManagerBean.selectedRedemption.redemptionList.stakeholder.corpContactNumber}" />

                <h:outputText value="Email address: " />
                <h:outputText value="#{tCubeULPManagerBean.selectedRedemption.redemptionList.stakeholder.corpEmail}" />

                <h:outputText value="Office number: " />
                <h:outputText value="#{tCubeULPManagerBean.selectedRedemption.redemptionList.stakeholder.address.houseNumber}" />

                <h:outputText value="Building name: " />
                <h:outputText value="#{tCubeULPManagerBean.selectedRedemption.redemptionList.stakeholder.address.buildingName}" />

                <h:outputText value="Street name: " />
                <h:outputText value="#{tCubeULPManagerBean.selectedRedemption.redemptionList.stakeholder.address.streetName}" />

                <h:outputText value="Postal code: " />
                <h:outputText value="#{tCubeULPManagerBean.selectedRedemption.redemptionList.stakeholder.address.postalCode}" />

            </h:panelGrid>
        </p:fieldset>
        <br/>
        <p:commandButton id="back" value="Back" ajax="true" action="staff/TCubeViewRedemptions?faces-redirect=true"/> 
    </ui:define>
</ui:composition>
